import {Component, OnInit} from '@angular/core';
import {Ranking} from "../ranking/ranking";
import {NewsService} from "./news.service";
import {News} from "./news";

@Component({
  selector: 'app-news',
  templateUrl: './news.component.html',
  styleUrls: ['./news.component.css']
})
export class NewsComponent implements OnInit {

  constructor(
    private newsService: NewsService
  ) {
  }

  ngOnInit(): void {
    this.getNewsList();
  }

  newsList: News[] = []

  getNewsList() {
    this.newsService.getHttpNewsList().subscribe(data => (this.newsList = data))
  }
}
